import React from 'react'
import { withRouter } from 'react-router-dom'
import { ArrowLeftOutlined } from '@ant-design/icons';

class Index extends React.Component{
    constructor(props) {
        super(props)
    }

    render() {
        return (
            <div style={{display: 'flex', justifyContent: 'space-between', flexWrap: 'wrap', padding: '16px 0 12px 0', alignItems: 'center', fontSize: '16px', color: '#ccc'}}>
                <ul style={{display: 'flex', marginTop: '8px'}}>
                    <li style={{marginRight: '8px'}}>当前位置: </li>
                    {
                        this.props.arr.map((item, index) => (
                            <li key={index}>{index > 0 && <span>&nbsp;&gt;&nbsp;</span>}{item}</li>
                        ))
                    }
                </ul>
                {
                    this.props.arr.length > 2
                    && <div style={{marginTop: '8px'}} onClick={() => this.props.history.go(-1)}><ArrowLeftOutlined/>返回</div>
                }
            </div>
        )
    }
}
export default withRouter(Index)